package com.flst;

import com.google.inject.Inject;

public class BookService {
	
	@Inject
	BookDAO bookDAO;
	
	
	public Book addNewBook(String string) {
		Book book = new Book(string);
		return bookDAO.saveBook(book);
	}
	
	public void linkAuthorToBook(Author author, Book book) {
		book.getAuthorList().add(author);
		author.getBooksList().add(book);
		
		bookDAO.saveBook(book);
		// authorDAO.saveAuthor(author);
		// L'un ou l'autre, ou les deux fonctionnent
		
	}

}
